Print enum list of a 'Type" in a Module

Hi,

Is it possible to print the enumeration list of a Type in a Module?
I've got a type thats base type is enumeration and i want to print the values and the accessory related numbers.

I only know (since Pekka told me) how to get these values for an object, but not how to print the whole list..

Regards,
Manuel
ManuelFelger - Mon Aug 31 10:51:04 EDT 2009

Re: Print enum list of a 'Type" in a Module
SystemAdmin - Tue Sep 01 01:05:23 EDT 2009

The key to this is to use the "size" property of an attribute type and print out the values and string arrays (these are all BTW desctibed in DXL Help).
 

Module m = current
AttrType at = null
int AttrSize = 0
int i = 0
AttrDef ad = find(m, "Requirement")
 
if (!null ad)
  {
     at = ad.type
     AttrSize = at.size
     for (i=0;i<AttrSize;i++)
        {
          print at.values[i] ": " at.strings[i] "\n"
        }
  }

Re: Print enum list of a 'Type" in a Module
ManuelFelger - Wed Sep 02 07:24:22 EDT 2009

SystemAdmin - Tue Sep 01 01:05:23 EDT 2009

The key to this is to use the "size" property of an attribute type and print out the values and string arrays (these are all BTW desctibed in DXL Help).
 

Module m = current
AttrType at = null
int AttrSize = 0
int i = 0
AttrDef ad = find(m, "Requirement")
 
if (!null ad)
  {
     at = ad.type
     AttrSize = at.size
     for (i=0;i<AttrSize;i++)
        {
          print at.values[i] ": " at.strings[i] "\n"
        }
  }

Thanks a lot!